#include<iostream>
#include<ctime>
using namespace std;
const int N = 1e6 + 10;
int a[N],n;
int random(int left,int right)
{
	return a[rand() % (right - left + 1) + left];
}
void quick_sort(int left, int right)
{
	if (left >= right) return;
	int t = random(left, right);
	int l = left - 1; int r = right + 1;int i = left;
	while (i < r)
	{
		if (a[i] < t) swap(a[++l], a[i++]);
		else if (a[i] == t) i++;
		else swap(a[i], a[--r]);
	}
	quick_sort(left,l);
	quick_sort(r,right);
}
int main()
{
	srand(time(0));
	cin >> n;
	for (int i = 1; i <=  n; i++)
	{
		cin >> a[i];
	}
	quick_sort(1, n);
	for (int i = 1; i <= n; i++)
	{
		cout << a[i] << ' ';
	}
	return 0;
}